#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

struct vector {
	int *data;
	size_t length;
	size_t length_max;
};

void
vector_init_(struct vector *v)
{
	v->data = (int *) calloc((size_t) 4, sizeof *v->data);
	v->length = 0UL;
	v->length_max = 4UL;
}

void
vector_add(struct vector *v, int a)
{
	if (v->length + 1UL > v->length_max)
		v->data = (int *) realloc(v->data,
				(sizeof *v->data) * (v->length_max *= 2));
	v->data[v->length++] = a;
}

void
vector_kill_(struct vector *v)
{
	free(v->data);
	v->length = v->length_max = 0UL;
}

void
e_s_populate(struct vector *v, const int amount)
{
#define LIM	3000000
	int *integers, integers_len;
	register long long i, j;

	integers = (int *) malloc((LIM + 1UL) * sizeof *integers);
	integers_len = LIM + 1;
	for (i = 0; i <= LIM; i++) integers[i] = i;

	for (i = 2; i < LIM; i++) {
		if (integers[i] != 0) {
			vector_add(v, i);
			for (j = i * i; j < LIM; j += i)
				integers[j] = 0;
		}
	}

	free(integers);
#undef LIM
}

int
main(int argc, char **argv)
{
	int n, i;
	struct vector es;

	scanf("%d", &n);

	vector_init_(&es);
	e_s_populate(&es, n);

	for (i = 0; i < n; i++)
		printf("%d ", es.data[i]);
	fputc('\n', stdout);

	vector_kill_(&es);

	return 0;
}
